package index.oop.lesson;

import java.util.stream.StreamSupport;

public class instanceUser {
    public static void main(String[] args) {
//        测试
        User2 u2=new User2("1213","23","123","212","male");
        System.out.println(u2.toString());

        u2.setCode("1213");
        u2.register();
        int []arr=new int[]{1,2,3};
        int res=Find(arr,2);
        System.out.println(res);

    }

    //顺序查找
    public static int Find(int[]arr,int indexContent){
        for (int i = 0; i < arr.length; i++) {
            //找到了就返回下标
            if(arr[i]==indexContent)return i;
        }
        //没有找到就返回下标-1;
        return -1;
    }



}
